package com.workcell.workdata.xthings.mapper;

import com.workcell.workdata.common.data.datascope.WorkdataBaseMapper;
import com.workcell.workdata.xthings.entity.CodeChainnumUseStateData;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.Date;
import java.util.List;

/**
 * 二维码码库每点使用状态
 *
 * @author guoyu
 * @date 2023-2-25 09:34:00
 */
@Mapper
public interface CodeChainnumUseStateDataMapper extends WorkdataBaseMapper<CodeChainnumUseStateData> {
    @Select({"<script>",
            "select * from t_code_chainnum_use_state_data where hardware_type=#{hardwareType} ",
            "<if test='scheduledTime!=null'>",
            "and scheduled_time = #{scheduledTime}",
            "</if>",
            "</script>"})
    List<CodeChainnumUseStateData> getCountByTypeAndTime(@Param("hardwareType") String hardwareType, @Param("scheduledTime") Date scheduledTime);
}
